home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 4
/
Info_Mac IV CD-ROM (Pacific HiTech Inc.)(August 1994).iso
/
Science
/
RLaB
/
help
/
diag
< prev
next >
Wrap
Text File
|
1994-04-25
|
533b
|
21 lines
diag:
Syntax: diag ( A )
diag ( A , K )
Description:
If the 1st argument is a 1xN matrix construct a diagonal
matrix from the input . Optionally if K (scalar) is specified
then create a matrix with the vector as the Kth diagonal.
If the 1st argument is a MxN matrix, construct a 1xN matrix
from the diagonal elements of the input matrix. Optionally if
K is specified return the vector from the Kth diagonal of the
input matrix.
K < 0 is below the main diagonal.
K > 0 is above the main diagonal.
See Also: tril, triu